<html>
    <head>
        <meta charset="utf-8">
        <title>Hello world</title>
    </head>
    <body>
        <p>Hello world 1</p>
        <p>Hello world 2</p>
        <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>
        <script>
           //线性比例尺
        //    var dataset = [1.2,2.3,0.9,1.5,3.3]
        //    var min = d3.min(dataset)
        //    var max = d3.max(dataset)
        //    var linear = d3.scale.linear().domain([min,max]).range([0,300])
        //    console.log(linear(0.9))
        //    console.log(linear(2.3))
        //    console.log(linear(3.3))
           //序数比例尺
           var index = [0,1,2,3,4]
           var color = ["red","blue","green","yellow","black"]
           var ordinal = d3.scale.ordinal().domain(index).range(color)
           console.log(ordinal(0))
           console.log(ordinal(2))
           console.log(ordinal(6))

        </script>
    </body>
</html>